<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 2021-02-07
 * Time: 16:44
 */

namespace app\api\controller\v1;


use app\api\service\AudioUploadSer;
use app\lib\exception\file\FileException;
use think\facade\Request;

class Audio
{
    public function audioUpload()
    {
        try {
            $request = Request::file();
        } catch (\Exception $e) {
            throw new FileException([
                'msg' => [
                    'video' => '字段中含有非法字符'
                ],
            ]);
        }
        $file = (new AudioUploadSer($request,[ 'single_limit' => 20971520, 'excludes' => ['.mp4'] ]))->upload();
        return $file;
    }
}